<template>
  <div class="course-item" ref="course">
    <div class="date">{{courseItem.date}}</div>
    <div class="circle" :style="{'--circleHeight':circleHeight + 'px'}"></div>
    <div class="course-conten-container">
      <TrainCourseItemContent v-for="item in courseItem.userTrainingCourses" :key="item.id" :itemObj="item"/>
      <CourseItemContent v-for="item in courseItem.userCourses" :key="item.id" :itemObj="item"/>
    </div>
  </div>
</template>

<script>
  import TrainCourseItemContent from '@/components/TrainCourseItemContent' // secondary package based on el-pagination
  import CourseItemContent from '@/components/CourseItemContent' // secondary package based on el-pagination
  export default {
    name: "index",
    props: {
      courseItem:{
        require:true,
        type: Object,
      },
    },
    data(){
      return{
        circleHeight:79
      }
    },
    components: {
      CourseItemContent,
      TrainCourseItemContent,
    },
    mounted(){
      this.circleHeight = this.$refs.course.clientHeight/2 -10
    }
  }
</script>

<style scoped lang="scss">
  @import "~@/styles/variables.scss";
  @import "index";
</style>
